import React, { Suspense } from "react";
import { Link, useRoutes } from "react-router-dom";
import routes from "./router";

import AppHeader from "./components/AppHeader";
import AppFooter from "./components/AppFooter";


function App() {
  return (
    <div className="App">
      <AppHeader />
      <Suspense fallback={<div>loading...</div>}>
        <div className="main">
          {/* 路由 */}
          {useRoutes(routes)}
        </div>
      </Suspense>
      <AppFooter />

    </div>
  );
}

export default App;
